# !/usr/bin/python3
# -*- coding: utf-8 -*-
# @Time    : 2021/10/27 15:20
# @Author  : zuodengbo
# @Email   : zuodb@amoydx.com
# @File    : models
# @Software: PyCharm
from tortoise.models import Model
from tortoise import fields

from utils.common import time_now


class APSPInspectionApplyCompany(Model):
    """
    AP SP inspection apply company model
    """
    EFFECT = (
        (0, "无效"),
        (1, "有效")
    )
    DEL = (
        (0, "未废除"),
        (1, "已废除")
    )
    LIMIT = (
        (0, "否"),
        (1, "是")
    )
    id = fields.IntField(pk=True, description="")
    applyCompanyNo = fields.CharField(max_length=50, description="申请单位编号")
    applyCompanyNm = fields.CharField(max_length=200, description="申请单位名称")
    mark = fields.CharField(max_length=200, description="标记")
    canUseInvoiceTypes = fields.CharField(max_length=200, description="可使用的服务票类型")
    isEffect = fields.IntField(choices=EFFECT, default=1, description="是否有效，0-无效，1-有效")
    isDel = fields.IntField(choices=DEL, default=0, description="是否废除 0-未废除，1-已废除")
    isrtEmpId = fields.IntField(description="是否是rt emp编号, 0-否， 1-是")
    isrtDt = fields.DatetimeField(description="rt datetime")
    updtEmpId = fields.IntField(description="更新emp编号")
    updtDt = fields.DatetimeField(description="更新时间")
    isDownloadRptLimit = fields.IntField(choices=LIMIT, default=1, description="是否限制下载rpt 0-否，1-是")
    projectTypeId = fields.IntField(default=1, description="项目类型标识")

    class Meta:
        table = "tbl_ap_sp_inspection_apply_company"


class APSPPackage(Model):
    """
    AP SP package model
    """
    EFFECT = (
        (0, "无效"),
        (1, "有效")
    )
    DEL = (
        (0, "未废除"),
        (1, "已废除")
    )
    MASTER = (
        (0, "否"),
        (1, "是")
    )
    id = fields.IntField(pk=True, description="")
    packageNo = fields.CharField(max_length=50, null=True, description="套餐编号")
    packageNm = fields.CharField(max_length=100, description="套餐名称")
    packageAmount = fields.IntField(description="套餐数量")
    packagePrice = fields.FloatField(description="套餐价格")
    mark = fields.CharField(max_length=200, null=True, description="标记")
    isEffect = fields.IntField(choices=EFFECT, default=1, description="是否有效")
    isDel = fields.IntField(choices=DEL, default=0, description="是否废弃")
    updtDt = fields.DatetimeField(description="更新时间")
    updtEmpId = fields.IntField(description="更新emp编号")
    isrtDt = fields.DatetimeField(description="rt时间")
    isrtEmpId = fields.IntField(description="rt emp编号")
    packagePrice_ky = fields.FloatField(description="套餐价格ky")
    packagePrice_dz = fields.FloatField(description="套餐价格dz")
    packagePrice_mf = fields.FloatField(description="套餐价格mf")
    packagePrice_qy = fields.FloatField(description="套餐价格qy")
    priceStartDate = fields.DatetimeField(null=True, description="价格开始时间")
    priceEndDate = fields.DatetimeField(null=True, description="价格结束时间")
    projectTypeId = fields.IntField(description="项目类型编号")
    projectItemId = fields.IntField(description="具体项目编号")
    saleEmpId = fields.IntField(description="销售员工编号")
    isMaster = fields.IntField(choices=MASTER, default=1, description="是否是master")
    sortIndex = fields.IntField(description="排序索引")

    class Meta:
        table = "tbl_ap_sp_package"


class APSPPackageDetail(Model):
    """
    AP SP package detail model
    """

    id = fields.IntField(pk=True, description="标识")
    packageId = fields.IntField(description="套餐标识")
    inspectionItemId = fields.IntField(description="检验项目标识")

    class Meta:
        table = "tbl_ap_sp_package_detail"


class APSPPathologicalDiagnosis(Model):
    """
    AP SP Pathological Diagnosis
    """

    id = fields.IntField(pk=True, description="标识")
    pathologicalDiagnosisNo = fields.CharField(max_length=50, description="病理诊断编号")
    pathologicalDiagnosisNm = fields.CharField(max_length=200, description="病理诊断名称")
    mark = fields.CharField(max_length=200, description="标记")
    isEffect = fields.IntField(description="是否有效")
    isDel = fields.IntField(description="是否废弃")
    isrtEmpId = fields.IntField(description="rt emp 编号")
    isrtDt = fields.DatetimeField(description="rt时间")
    updtEmpId = fields.IntField(description="更新emp编号")
    updtDt = fields.DatetimeField(description="更新时间")
    tumor_id = fields.IntField(description="肿瘤标识")

    class Meta:
        table = "tbl_ap_sp_pathological_diagnosis"


class APSPSampleInspectionApplyBill(Model):
    """
    AP SP sample inspection apply bill model
    """

    id = fields.IntField(pk=True, description="标识")
    billNo = fields.CharField(max_length=50, description="单号流水")
    sampleInspectionBillBarCode = fields.CharField(max_length=50, description="样品检查账单栏编码")
    saleEmpId = fields.IntField(description="销售员编号")
    applyCompany = fields.CharField(max_length=100, description="申请单位")
    sampleSourceId = fields.IntField(description="样品源编号")
    pathologicalDiagnosisIds = fields.CharField(max_length=200, description="病理诊断编号集合")
    pathologicalDiagnosisNms = fields.CharField(max_length=100, description="病理诊断名称集合")
    pathologicalDiagnosisOther = fields.CharField(max_length=100, null=True, description="病理诊断其它")
    pathologicalNo = fields.CharField(max_length=50, null=True, description="病理编号")
    receiveDt = fields.DatetimeField(description="接收日期")
    gatherDt = fields.DatetimeField(null=True, description="搜集日期")
    sampleTypeIds = fields.CharField(max_length=128, description="样品类型编号集合")
    sampleTypeNms = fields.CharField(max_length=200, description="样品类型名称集合")
    sampleTypeOther = fields.CharField(max_length=200, null=True, description="样品类型其它")
    sampleAmount1 = fields.IntField(null=True, description="样品数量1")
    sampleAmount2 = fields.IntField(null=True, description="样品数量2")
    sampleAmount3 = fields.IntField(null=True, description="样品数量3")
    sampleAmount4 = fields.IntField(null=True, description="样品数量4")
    sampleCaseNum = fields.IntField(null=True, description="样品示例流水号")
    deliveryNo = fields.CharField(max_length=100, description="寄送编号")
    inspectionPlace = fields.CharField(max_length=20, description="检查地")
    projectId = fields.IntField(description="项目标识")
    invoiceItem = fields.CharField(max_length=100, description="发票实体")
    invoiceTitleType = fields.CharField(max_length=100, description="发票标题类型")
    invoiceTitle = fields.CharField(max_length=100, description="发票标题")
    applyCode = fields.CharField(max_length=100, null=True, description="申请编号")
    inspectionReportType = fields.CharField(max_length=100, description="检查报告类型")
    inspectionReportNo = fields.CharField(max_length=50, null=True, description="检查报告编号")
    sendSampleType = fields.CharField(max_length=50, description="发送样品方式")
    price = fields.FloatField(description="价格")
    invoiceDate = fields.DateField(null=True, description="发票日期")
    invoiceDt = fields.DatetimeField(null=True, description="发票时间")
    invoiceNo = fields.CharField(max_length=50, null=True, description="发票编号")
    invoiceMoney = fields.FloatField(null=True, description="发票金额")
    mark = fields.TextField(null=True, description="备注")
    isrtEmpId = fields.IntField(description="rt emp编号")
    departId = fields.IntField(description="科室编号")
    isrtDt = fields.DatetimeField(description="rt 时间")
    updtEmpId = fields.IntField(description="更新 emp 标识")
    updtDt = fields.DatetimeField(null=True, description="更新时间")
    state = fields.CharField(max_length=10, description="状态, 提交，未提交")
    commitDt = fields.DatetimeField(null=True, description="提交时间")
    commitEmpId = fields.IntField(default=0, description="提交人标识")
    workFlowId = fields.IntField(default=0, description="工作流标识")
    instantState = fields.CharField(max_length=10, description="即时状态")
    auditEmpId = fields.IntField(default=0, description="审核人标识")
    auditDt = fields.DatetimeField(null=True, description="审核时间")
    workFlowSeq = fields.CharField(max_length=50, null=True, description="工作流，审核通过，审核未通过")
    auditMark = fields.CharField(max_length=200, null=True, description="审核备注")
    auditProjectMemo = fields.TextField(null=True, description="审核项目备忘录")
    receiveCheckState = fields.CharField(max_length=20, null=True, description="接收检查状态")
    receiveCheckExceptionReasonId = fields.CharField(max_length=20, null=True, description="接收检查异常原因")
    receiveCheckDt = fields.DatetimeField(null=True, description="接收检查时间")
    receiveCheckEmpId = fields.IntField(default=0, description="接收检查人员标识")
    receiveCheckMark = fields.CharField(max_length=200, null=True, description="接收检查备注")
    sampleRegisterState = fields.CharField(max_length=20, null=True, description="样品注册状态")
    sampleRegisterDt = fields.DatetimeField(null=True, description="样品注册时间")
    sampleRegisterEmpId = fields.IntField(default=0, description="样品注册人员标识")
    postConfirmInspectionDt = fields.DatetimeField(null=True, description="提交确认检查时间")
    postConfirmInspectionEmpId = fields.IntField(default=0, description="提交确认检查人标识")
    postConfirmExpressCompany = fields.CharField(max_length=200, null=True, description="提交确认单位")
    postConfirmBillNo = fields.CharField(max_length=20, null=True, description="提交确认账单编号")
    postConfirmState = fields.CharField(max_length=20, null=True, description="提交确认状态")
    postConfirmDt = fields.DatetimeField(null=True, description="提交确认时间")
    postConfirmEmpId = fields.IntField(default=0, description="提交确认人员标识")
    signConfirmState = fields.CharField(max_length=20, null=True, description="签署确认状态")
    signConfirmDt = fields.DatetimeField(null=True, description="签署确认时间")
    signConfirmEmpId = fields.IntField(default=0, description="签署确认人标识")
    signDt = fields.CharField(max_length=20, null=True, description="签署时间")
    signEmp = fields.CharField(max_length=20, null=True, description="签署人")
    deliveryCompany = fields.CharField(max_length=200, null=True, description="寄送单位")
    makeEmpNm = fields.CharField(max_length=50, null=True, description="经办人名称")
    makeBank = fields.CharField(max_length=50, null=True, description="经办银行")
    makeMoneysum = fields.FloatField(null=True, description="经办金额总量")
    makeVouchFileIds = fields.CharField(max_length=200, null=True, description="经办担保文件编号集合")
    sendAddress = fields.CharField(max_length=200, null=True, description="寄送地址")
    inspectionApplyFileIds = fields.CharField(max_length=200, null=True, description="检查申请文件标识集合")
    makeEmpType = fields.CharField(max_length=50, null=True, description="经办人类型")
    packagePic = fields.CharField(max_length=50, null=True, description="套餐图片")
    sampleAmount = fields.CharField(max_length=100, description="样品数量")
    projectItemId = fields.IntField(default=0, description="项目示例编号")
    inspectionReportBackMark = fields.TextField(null=True, description="检查报告反馈备注")
    inspectionReportBackDt = fields.DatetimeField(null=True, description="检查报告反馈时间")
    inspectionReportBackEmpId = fields.IntField(null=True, description="检查报告反馈人员标识")
    postBackMark = fields.CharField(max_length=200, null=True, description="上送反馈备注")
    postBackDt = fields.DatetimeField(null=True, description="上送反馈时间")
    postBackEmpId = fields.IntField(null=True, description="上送反馈人标识")
    signBackMark = fields.CharField(max_length=200, null=True, description="签署反馈备注")
    signBackDt = fields.DatetimeField(max_length=50, null=True, description="签署反馈时间")
    signBackEmpId = fields.IntField(null=True, description="签署反馈人标识")
    applyCompanySender = fields.CharField(max_length=50, null=True, description="申请单位寄送人")
    smsNum = fields.IntField(null=True, description="短信编号")
    userLoginNum = fields.IntField(null=True, description="用户登录编号")
    inspectionReportMark = fields.CharField(max_length=200, null=True, description="检查报告备注")

    class Meta:
        table = "tbl_ap_sp_sample_inspection_apply_bill"


class APSPSampleInspectionApplyDetail(Model):
    """
    AP SP sample inspection apply detail model
    """

    id = fields.IntField(pk=True, description="标识")
    billNo = fields.CharField(max_length=50, description="账单编号")
    isPackage = fields.IntField(default=0, description="是否选择套餐")
    packageId = fields.IntField(default=0, description="套餐编号")
    inspectionItemId = fields.IntField(description="检查条目标号")
    standardPrice = fields.FloatField(description="标价")
    Num = fields.IntField(description="数量")
    calcPrice = fields.FloatField(description="折扣价")

    class Meta:
        table = "tbl_ap_sp_sample_inspection_apply_detail"


class APSPSampleInspectionItem(Model):
    """
    AP SP sample inspection item model
    """
    EFFECT = (
        (0, "无效"),
        (1, "有效")
    )
    DEL = (
        (0, "未废除"),
        (1, "已废除")
    )

    id = fields.IntField(pk=True, description="标识")
    inspectionItemNo = fields.CharField(max_length=64, description="检查条目编号")
    inspectionItemNm = fields.CharField(max_length=100, description="检查条目名称")
    inspectionPlatformId = fields.IntField(description="检查平台编号")
    standardPrice = fields.FloatField(description="标价")
    mark = fields.TextField(null=True, description="备注")
    isEffect = fields.IntField(choices=EFFECT, default=1, description="是否有效")
    isDel = fields.IntField(choices=DEL, default=0, description="是否废弃")
    isrtEmpId = fields.IntField(null=True, description="isrt emp标识")
    isrtDt = fields.DatetimeField(null=True, description="isrt时间")
    updtEmpId = fields.IntField(null=True, description="更新人标识")
    updtDt = fields.DatetimeField(null=True, description="更新时间")
    sortId = fields.IntField(description="排序标识")
    standardPrice_ky = fields.FloatField(null=True, description="标价ky")
    standardPrice_dz = fields.FloatField(null=True, description="标价dz")
    standardPrice_mf = fields.FloatField(null=True, description="标价mf")
    standardPrice_qy = fields.FloatField(null=True, description="标价qy")
    priceStartDate = fields.DateField(null=True, description="价格开始日期")
    priceEndDate = fields.DateField(null=True, description="价格结束日期")
    projectTypeId = fields.IntField(description="项目类型标识")
    projectItemId = fields.IntField(description="项目条目标识")
    saleEmpId = fields.IntField(description="销售人员标识")
    isMaster = fields.IntField(default=0, description="是否master产品")

    class Meta:
        table = "tbl_ap_sp_sample_inspection_item"


class APSPSampleSource(Model):
    """
    AP SP sample source model
    """
    EFFECT = (
        (0, "无效"),
        (1, "有效")
    )
    DEL = (
        (0, "未废除"),
        (1, "已废除")
    )

    id = fields.IntField(pk=True, description="标识")
    sampleSourceTypeId = fields.IntField(default=0, description="样品源类型标识")
    sampleSourceNo = fields.CharField(max_length=50, description="样品源编号")
    sampleSourceNm = fields.CharField(max_length=100, description="样品源名称")
    sampleSourceDesc = fields.TextField(null=True, description="样品源描述")
    idCard = fields.CharField(max_length=50, null=True, description="身份证")
    telephone = fields.CharField(max_length=50, description="手机号")
    gender = fields.CharField(max_length=20, description="性别")
    age = fields.IntField(description="年龄")
    isSmoke = fields.CharField(max_length=10, description="是否抽烟")
    sampleSourceTypeExDataId = fields.IntField(description="其它数据标识")
    isEffect = fields.IntField(choices=EFFECT, default=1, description="是否有效")
    isDel = fields.IntField(choices=DEL, default=0, description="是否废弃")
    isrtDt = fields.DatetimeField(description="isrt时间")
    isrtEmpId = fields.IntField(description="isrt emp标识")
    updtDt = fields.DatetimeField(null=True, description="更新时间")
    updtEmpId = fields.IntField(default=0, description="更新人员标识")
    departId = fields.IntField(null=True, description="科室标识")

    class Meta:
        table = "tbl_ap_sp_sample_source"


class DrugFactory(Model):
    """
    Drug factory model
    """

    drug_factory_id = fields.IntField(pk=True, description="药厂标识")
    drug_factory_name = fields.CharField(max_length=64, description="药厂名称")

    class Meta:
        table = "tbl_drug_factory"


class GeneVarName(Model):
    """
    Gene var name model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    var_name = fields.CharField(max_length=256, index=True, description="变异名")
    gene_id = fields.IntField(max_length=256, description="基因标识")
    var_id = fields.CharField(max_length=32, index=True, description="变异标识")
    table_name = fields.CharField(max_length=32, description="知识库表名")
    table_class_name = fields.CharField(max_length=32, description="表对应的类名")
    gene_symbol = fields.CharField(max_length=256, description="基因标记")
    modify_user = fields.IntField(null=True, description="更新用户")
    modify_time = fields.DatetimeField(null=True, description="更新时间")
    audit_user = fields.IntField(null=True, description="审核用户")
    audit_time = fields.DatetimeField(null=True, description="审核时间")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.IntField(null=True, description="创建用户")
    category_id = fields.CharField(max_length=32, description="分类标识")
    status = fields.CharField(max_length=32, null=True, description="状态")

    class Meta:
        table = "tbl_k_gene_var_name"


class KPGx(Model):
    """
    Knowledge PGx model
    """
    STATUS = (
        (0, "未启用"),
        (1, "正常")
    )

    sq_no = fields.IntField(pk=True, description="序号")
    created_time = fields.DatetimeField(description="创建时间")
    tumor_id = fields.CharField(max_length=32, description="肿瘤标识")
    tumor_name_cn = fields.CharField(max_length=128, description="肿瘤中文名称")
    tumor_name_en = fields.CharField(max_length=128, description="肿瘤英文名称")
    phenotype_origin = fields.CharField(max_length=256, null=True, description="PharmGKB原始疾病表型记录")
    gene_id = fields.IntField(max_length=32, description="基因标识")
    gene_symbol = fields.CharField(max_length=64, index=True, description="基因标记")
    dbsnp = fields.CharField(max_length=32, description="位点dbsnp名")
    genotype = fields.CharField(max_length=64, description="位点基因型")
    impact_type_en = fields.CharField(max_length=32, description="影响类型英文")
    impact_type_cn = fields.CharField(max_length=32, description="影响类型中文")
    drug_name_en = fields.CharField(max_length=256, description="药物名英文")
    drug_name_cn = fields.CharField(max_length=256, description="药物名中文")
    evi_level = fields.CharField(max_length=8, description="证据等级")
    clin_anno_en = fields.TextField(description="临床意义注释英文")
    clin_anno_cn = fields.TextField(description="临床意义注释中文")
    editor = fields.CharField(max_length=32, description="编辑者")
    data_source = fields.CharField(max_length=256, description="对应版本 数据爬取来源+日期")
    creator = fields.CharField(max_length=32, null=True, description="创建者")
    note = fields.TextField(null=True, description="备注")
    status = fields.IntField(default=1, description="状态")

    class Meta:
        table = "tbl_k_pgx"


class KAttach(Model):
    """
    Knowledge attach model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    refer_id = fields.IntField(description="参考标识")
    refer_path = fields.CharField(max_length=256, description="参考路径")
    refer_attach_name = fields.CharField(max_length=128, description="参考名称")

    class Meta:
        table = "tbl_k_attach"


class KBiok(Model):
    """
    Knowledge biok model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    biok_id = fields.IntField(description="生物标志物id")
    omics_level = fields.CharField(max_length=32, description="组学类型")
    biok_name = fields.CharField(max_length=128, description="生物标志物名称")
    biok_clin_sign = fields.TextField(null=True, description="生物标志物临床意义")
    biok_group = fields.CharField(max_length=64, null=True, description="生物标志物分组")
    creator = fields.CharField(max_length=64, null=True, description="创建者")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    editor = fields.CharField(max_length=64, null=True, description="编辑者")
    edit_time = fields.DatetimeField(null=True, description="编辑时间")
    note = fields.TextField(null=True, description="备注")
    status = fields.IntField(null=True, description="状态")

    class Meta:
        table = "tbl_k_biok"


class KBiokCategory(Model):
    """
    Knowledge biok category model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    biok_id = fields.IntField(description="生物标志物id")
    biok_category_id = fields.CharField(max_length=32, description="biomarker的category类型ID")
    biok_category_name = fields.CharField(max_length=128, description="biomarker的category类型命名")
    creator = fields.CharField(max_length=64, null=True, description="创建者")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    editor = fields.CharField(max_length=64, null=True, description="编辑者")
    edit_time = fields.DatetimeField(null=True, description="编辑时间")
    note = fields.TextField(null=True, description="备注")
    status = fields.IntField(default=1, description="状态")

    class Meta:
        table = "tbl_k_biok_category"


class KBiomarker(Model):
    """
    Knowledge biomarker model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    biomarker_id = fields.CharField(max_length=256, description="生物标志物标识")
    biomarker_name = fields.CharField(max_length=256, description="生物标志物名称")
    drug_name = fields.CharField(max_length=256, description="药名")
    evidence = fields.CharField(max_length=256, description="证据")
    introduction = fields.CharField(max_length=256, null=True, description="介绍")
    audit_time = fields.DatetimeField(null=True, description="审核时间")
    audit_user = fields.IntField(null=True, description="审核人")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.IntField(null=True, description="创建人")
    modify_time = fields.DatetimeField(null=True, description="更新时间")
    modify_user = fields.IntField(null=True, description="更新用户")
    status = fields.IntField(default=1, description="状态")

    class Meta:
        table = "tbl_k_biomarker"


class KCategoryIntegration(Model):
    """
    Knowledge category integration model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    var_category_id = fields.IntField(description="变异种类标识")
    gene_symbol = fields.CharField(max_length=256, index=True, description="基因标记")
    gene_id = fields.IntField(index=True, description="基因标识")
    var_category_name = fields.CharField(max_length=64, index=True, description="变异种类名称")
    category_type_id = fields.IntField(description="种类类型标识")
    category_type = fields.CharField(max_length=64, description="种类类型")
    preferred_name = fields.CharField(max_length=64, null=True, description="首选（统一）名称")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.CharField(max_length=32, description="创建人")
    audit_time = fields.DatetimeField(null=True, description="审核时间")
    audit_user = fields.CharField(max_length=32, null=True, description="审核人")
    last_time = fields.DatetimeField(auto_now=True, default=time_now(), description="最后编辑时间")
    last_editor = fields.CharField(max_length=32, null=True, description="最后编辑人")
    status = fields.IntField(default=1, description="状态")
    note = fields.TextField(null=True, description="备注")

    class Meta:
        table = "tbl_k_category_integration"


class KChemoClin(Model):
    """
    Knowledge chemo clin model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    drug_name = fields.CharField(max_length=100, description="药名")
    drug_name_en = fields.CharField(max_length=100, description="药名-英文")
    tumor_id = fields.IntField(description="肿瘤标识")
    tumor_name_cn = fields.CharField(max_length=100, description="肿瘤名称-中文")
    tumor_name_en = fields.CharField(max_length=100, description="肿瘤名称-英文")
    gene_symbol = fields.CharField(max_length=50, index=True, description="基因标记")
    dbsnp = fields.CharField(max_length=50, description="位点dbsnp名")
    genotype = fields.CharField(max_length=200, description="位点基因型")
    rs_genotype_anno_cn = fields.CharField(max_length=200, null=True, description="位点基因型注释-中文")
    rs_genotype_anno_type = fields.CharField(max_length=200, null=True, description="位点基因型注释-类型")
    rs_genotype_anno_con = fields.CharField(max_length=200, description="位点基因型注释-结论")
    evidence_level = fields.IntField(description="证据等级")
    comment01 = fields.TextField(null=True, description="解释1")
    comment02 = fields.TextField(null=True, description="解释2")
    f16 = fields.CharField(max_length=50, null=True, description="")

    class Meta:
        table = "tbl_k_chemo_clin"


class KClinicaltrialCn(Model):
    """
    Knowledge clinical trial cn model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    clinicaltrial_number = fields.CharField(max_length=50, description="临床试验编号")
    conditions = fields.TextField(description="条件")
    study_title_common = fields.TextField(description="研究标题-通用")
    study_title = fields.TextField(description="研究标题")
    interventions = fields.TextField(description="介入")
    drug_type = fields.CharField(max_length=100, description="药物类型")
    study_goal = fields.TextField(description="研究目的")
    study_type = fields.CharField(max_length=100, description="研究类型")
    phase = fields.CharField(max_length=10, description="阶段")
    status = fields.CharField(max_length=20, description="状态")

    class Meta:
        table = "tbl_k_clinical_trial_cn"


class KClinicaltrialCnGene(Model):
    """
    Knowledge clinical trial cn gene model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    clinicaltrial_number = fields.CharField(max_length=200, description="临床试验编号")
    biomarker = fields.CharField(max_length=200, description="基因标志物")

    class Meta:
        table = "tbl_k_clinical_trial_cn_gene"


class KClinicaltrialCnTumor(Model):
    """
    Knowledge clinical trial cn tumor model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    clinicaltrial_number = fields.CharField(max_length=200, description="临床试验编号")
    tumor_group_id = fields.IntField(description="肿瘤组标识")
    tumor_id = fields.IntField(description="肿瘤标识")
    tumor_name_en = fields.CharField(max_length=200, description="肿瘤名称-英文")
    tumor_name_cn = fields.CharField(max_length=200, description="肿瘤名称-中文")

    class Meta:
        table = "tbl_k_clinical_trial_cn_tumor"


class KClinicaltrialEn(Model):
    """
    Knowledge clinical trial en model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    Gene = fields.CharField(max_length=200, description="基因")
    NCT_Number = fields.CharField(max_length=200, description="NCT编号")
    Study_Title = fields.TextField(description="研究标题")
    Status = fields.CharField(max_length=200, description="状态")
    Conditions = fields.CharField(max_length=200, description="条件")
    Interventions = fields.CharField(max_length=200, null=True, description="介入")
    Phase = fields.CharField(max_length=200, description="阶段")
    First_Posted = fields.DateField(description="首次发布日期")
    Last_Update_Posted = fields.DateField(description="最后更新发布日期")

    class Meta:
        table = "tbl_k_clinical trial_en"


class KCnv(Model):
    """
    Knowledge cnv model
    """
    sq_no = fields.IntField(pk=True, description="序号")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.IntField(null=True, description="创建用户")
    var_id = fields.CharField(max_length=32, description="cnv变异标识")
    gene_id = fields.IntField(max_length=32, description="基因标识")
    gene_symbol = fields.CharField(max_length=256, description="基因标记")
    region_exon = fields.CharField(max_length=256, null=True, description="外显子区域")
    cnv_type = fields.CharField(max_length=256, description="cnv类型")
    primary_transcript = fields.CharField(max_length=256, null=True, description="原转录本")
    cn_mean = fields.FloatField(null=True, description="平均拷贝数")
    audit_time = fields.DatetimeField(null=True, description="审核时间")
    audit_user = fields.IntField(null=True, description="审核人")
    modify_time = fields.DatetimeField(null=True, description="更新时间")
    modify_user = fields.IntField(null=True, description="更新用户")
    status = fields.IntField(default=1, description="状态")
    var_name = fields.CharField(max_length=256, description="变异名称")
    refer_id = fields.IntField(null=True, description="参考标识")
    pmid = fields.CharField(max_length=64, null=True, description="唯一标识码")
    interpretation = fields.TextField(null=True, description="说明")

    class Meta:
        table = "tbl_k_cnv"
        indexes = ("gene_symbol", "region_exon", "cnv_type")
        unique_together = ("gene_symbol", "region_exon", "cnv_type")


class KDictAcmgEviReason(Model):
    """
    Knowledge dict acmg evi reason model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    code = fields.CharField(max_length=32, unique=True, description="编码")
    value = fields.CharField(max_length=32, description="值")
    note = fields.TextField(null=True, description="备注说明")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.CharField(max_length=32, description="创建人")
    last_time = fields.DatetimeField(null=True, description="最后更新时间")
    last_editor = fields.CharField(max_length=32, null=True, description="最后编辑人")

    class Meta:
        table = "tbl_k_dict_acmg_evi_reason"


class KDictApprOrganization(Model):
    """
    Knowledge dict appr organization model
    """

    id = fields.IntField(pk=True, description="标识")
    organization = fields.CharField(max_length=64, description="组织")

    class Meta:
        table = "tbl_k_dict_appr_organization"


class KDictClinicDiagnostic(Model):
    """
    Knowledge dict clinic diagnostic model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    code = fields.CharField(max_length=32, unique=True, description="编码")
    value = fields.CharField(max_length=32, description="值")
    note = fields.TextField(null=True, description="备注说明")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.CharField(max_length=32, description="创建人")
    last_time = fields.DatetimeField(null=True, description="最后更新时间")
    last_editor = fields.CharField(max_length=32, null=True, description="最后编辑人")

    class Meta:
        table = "tbl_k_dict_clinic_diagnostic"


class KDictClinicPredictive(Model):
    """
    Knowledge dict clinic predictive model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    code = fields.CharField(max_length=32, unique=True, description="编码")
    value = fields.CharField(max_length=32, description="值")
    note = fields.TextField(null=True, description="备注说明")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.CharField(max_length=32, description="创建人")
    last_time = fields.DatetimeField(null=True, description="最后更新时间")
    last_editor = fields.CharField(max_length=32, null=True, description="最后编辑人")

    class Meta:
        table = "tbl_k_dict_clinic_predictive"


class KDictClinicPrognostic(Model):
    """
    Knowledge dict clinic prognostic model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    code = fields.CharField(max_length=32, unique=True, description="编码")
    value = fields.CharField(max_length=32, description="值")
    note = fields.TextField(null=True, description="备注说明")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.CharField(max_length=32, description="创建人")
    last_time = fields.DatetimeField(null=True, description="最后更新时间")
    last_editor = fields.CharField(max_length=32, null=True, description="最后编辑人")

    class Meta:
        table = "tbl_k_dict_clinic_prognostic"


class KDictClinicResearch(Model):
    """
    Knowledge dict clinic research model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    code = fields.CharField(max_length=32, unique=True, description="编码")
    value = fields.CharField(max_length=32, description="值")
    note = fields.TextField(null=True, description="备注说明")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.CharField(max_length=32, description="创建人")
    last_time = fields.DatetimeField(null=True, description="最后更新时间")
    last_editor = fields.CharField(max_length=32, null=True, description="最后编辑人")

    class Meta:
        table = "tbl_k_dict_clinic_research"


class KDictClinicTherapeutic(Model):
    """
    Knowledge dict clinic therapeutic model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    code = fields.CharField(max_length=32, unique=True, description="编码")
    value = fields.CharField(max_length=32, description="值")
    note = fields.TextField(null=True, description="备注说明")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.CharField(max_length=32, description="创建人")
    last_time = fields.DatetimeField(null=True, description="最后更新时间")
    last_editor = fields.CharField(max_length=32, null=True, description="最后编辑人")

    class Meta:
        table = "tbl_k_dict_clinic_therapeutic"


class KDictClinicalSignificance(Model):
    """
    Knowledge dict clinic significance model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    code = fields.CharField(max_length=32, unique=True, description="编码")
    value = fields.CharField(max_length=32, description="值")
    note = fields.TextField(null=True, description="备注说明")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.CharField(max_length=32, description="创建人")
    last_time = fields.DatetimeField(null=True, description="最后更新时间")
    last_editor = fields.CharField(max_length=32, null=True, description="最后编辑人")
    type = fields.CharField(max_length=128, description="类型")

    class Meta:
        table = "tbl_k_dict_clinical_significance"


class KDictCnvType(Model):
    """
    Knowledge dict cnv type model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    code = fields.CharField(max_length=32, unique=True, description="编码")
    value = fields.CharField(max_length=32, description="值")
    note = fields.TextField(null=True, description="备注说明")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.CharField(max_length=32, description="创建人")
    last_time = fields.DatetimeField(null=True, description="最后更新时间")
    last_editor = fields.CharField(max_length=32, null=True, description="最后编辑人")

    class Meta:
        table = "tbl_k_dict_cnv_type"


class KDictEviDirection(Model):
    """
    Knowledge dict evi direction model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    code = fields.CharField(max_length=32, unique=True, description="编码")
    value = fields.CharField(max_length=32, description="值")
    note = fields.TextField(null=True, description="备注说明")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.CharField(max_length=32, description="创建人")
    last_time = fields.DatetimeField(null=True, description="最后更新时间")
    last_editor = fields.CharField(max_length=32, null=True, description="最后编辑人")

    class Meta:
        table = "tbl_k_dict_evi_direction"


class KDictEviLevel(Model):
    """
    Knowledge dict evi level model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    code = fields.CharField(max_length=32, unique=True, description="编码")
    value = fields.CharField(max_length=32, description="值")
    note = fields.TextField(null=True, description="备注说明")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.CharField(max_length=32, description="创建人")
    last_time = fields.DatetimeField(null=True, description="最后更新时间")
    last_editor = fields.CharField(max_length=32, null=True, description="最后编辑人")

    class Meta:
        table = "tbl_k_dict_evi_level"


class KDictEviType(Model):
    """
    Knowledge dict evi type model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    code = fields.CharField(max_length=32, unique=True, description="编码")
    value = fields.CharField(max_length=32, description="值")
    note = fields.TextField(null=True, description="备注说明")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.CharField(max_length=32, description="创建人")
    last_time = fields.DatetimeField(null=True, description="最后更新时间")
    last_editor = fields.CharField(max_length=32, null=True, description="最后编辑人")

    class Meta:
        table = "tbl_k_dict_evi_type"


class KDictGeneRole(Model):
    """
    Knowledge dict gene role model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    role_code = fields.CharField(max_length=32, unique=True, description="编码")
    role_value = fields.CharField(max_length=32, description="值")
    note = fields.TextField(null=True, description="备注说明")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.CharField(max_length=32, description="创建人")
    last_time = fields.DatetimeField(null=True, description="最后更新时间")
    last_editor = fields.CharField(max_length=32, null=True, description="最后编辑人")

    class Meta:
        table = "tbl_k_dict_gene_role"


class KDictReferConfer(Model):
    """
    Knowledge dict refer confer model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    confer_id = fields.IntField(unique=True, description="会议id")
    confer_name = fields.CharField(max_length=32, description="会议名称")
    confer_year = fields.CharField(max_length=32, description="会议举办年份")
    last_edited = fields.DatetimeField(null=True, description="编辑时间")
    last_editor = fields.CharField(max_length=32, null=True, description="编辑人")

    class Meta:
        table = "tbl_k_dict_refer_confer"


class KDictReferJournal(Model):
    """
    Knowledge dict refer journal model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    journal_id = fields.IntField(unique=True, description="期刊号")
    journal_abbr = fields.CharField(max_length=256, description="期刊缩写")
    impact_factor = fields.CharField(max_length=32, description="影响因素")
    last_edited = fields.DatetimeField(null=True, description="编辑时间")
    last_editor = fields.CharField(max_length=32, null=True, description="编辑人")

    class Meta:
        table = "tbl_k_dict_refer_journal"


class KDictReferType(Model):
    """
    Knowledge dict refer type model
    """

    sq_no = fields.IntField(pk=True, description="标识")
    code = fields.IntField(unique=True, description="编码")
    refer_type = fields.CharField(max_length=32, description="参考类型")
    note = fields.TextField(description="备注")
    last_edited = fields.DatetimeField(null=True, description="编辑时间")
    last_editor = fields.CharField(max_length=32, null=True, description="编辑人")

    class Meta:
        table = "tbl_k_dict_refer_type"


class KDictRegimenLevel(Model):
    """
    Knowledge dict regimen level model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.CharField(max_length=32, null=True, description="创建人")
    code = fields.CharField(max_length=32, unique=True, description="编码")
    value = fields.CharField(max_length=32, description="值")
    note = fields.CharField(max_length=256, description="备注")
    last_time = fields.DatetimeField(null=True, description="编辑时间")
    last_editor = fields.CharField(max_length=32, null=True, description="编辑人")

    class Meta:
        table = "tbl_k_dict_regimen_level"


class KDictRegimenSignificance(Model):
    """
    Knowledge dict regimen significance model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.CharField(max_length=32, null=True, description="创建人")
    code = fields.CharField(max_length=32, unique=True, description="编码")
    value = fields.CharField(max_length=32, description="值")
    note = fields.CharField(max_length=256, description="备注")
    last_time = fields.DatetimeField(null=True, description="编辑时间")
    last_editor = fields.CharField(max_length=32, null=True, description="编辑人")

    class Meta:
        table = "tbl_k_dict_regimen_significance"


class KDictRegimenType(Model):
    """
    Knowledge dict regimen type model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    note = fields.CharField(max_length=256, description="备注")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.CharField(max_length=32, null=True, description="创建人")
    last_time = fields.DatetimeField(null=True, description="编辑时间")
    last_editor = fields.CharField(max_length=32, null=True, description="编辑人")

    class Meta:
        table = "tbl_k_dict_regimen_type"


class KDictVarAAPosition(Model):
    """
    Knowledge dict var aa position model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    note = fields.CharField(max_length=256, description="备注")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.CharField(max_length=32, null=True, description="创建人")
    last_time = fields.DatetimeField(null=True, description="编辑时间")
    last_editor = fields.CharField(max_length=32, null=True, description="编辑人")

    class Meta:
        table = "tbl_k_dict_var_aa_position"


class KDictVarCategory(Model):
    """
    Knowledge dict var category model
    """
    STATUS = (
        (0, "未启用"),
        (1, "启用")
    )

    sq_no = fields.IntField(pk=True, description="序号")
    var_category_id = fields.CharField(max_length=32, index=True, description="变异种类标识")
    gene_symbol = fields.CharField(max_length=64, index=True, description="基因标志")
    gene_id = fields.IntField(description="基因标识")
    var_aa_position = fields.CharField(max_length=64, null=True, description="aa位置")
    var_subgene = fields.CharField(max_length=64, null=True, description="亚基因")
    var_gene_domain = fields.CharField(max_length=64, null=True, description="基因域")
    var_cnv_exon = fields.CharField(max_length=64, null=True, description="cnv外显子")
    var_cnv_gene = fields.CharField(max_length=64, null=True, description="cnv基因")
    var_sv_gene_exon = fields.CharField(max_length=64, null=True, description="sv基因外显子")
    var_sv_gene_pair = fields.CharField(max_length=64, null=True, description="sv基因对")
    var_sv_func_gene = fields.CharField(max_length=64, null=True, description="sv功能基因")
    var_gene_function = fields.CharField(max_length=64, null=True, description="基因功能")
    audit_time = fields.DatetimeField(null=True, description="审核时间")
    audit_user = fields.IntField(null=True, description="审核人")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.IntField(description="创建人")
    modify_time = fields.DatetimeField(null=True, description="更新时间")
    modify_user = fields.IntField(null=True, description="更新人")
    status = fields.IntField(choices=STATUS, default=1, description="状态")
    vc_class_id = fields.IntField(null=True, description="变异种类类对象标识")
    vc_name = fields.CharField(max_length=64, null=True, description="变异种类名称")

    class Meta:
        table = "tbl_k_dict_var_category"


class KDictVarDomain(Model):
    """
    Knowledge dict var domain model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    code = fields.CharField(max_length=32, description="编码")
    domain_value = fields.CharField(max_length=64, description="域值")
    gene_id = fields.IntField(description="基因标识")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.CharField(max_length=32, null=True, description="创建人")
    last_time = fields.DatetimeField(null=True, description="编辑时间")
    last_editor = fields.CharField(max_length=32, null=True, description="编辑人")
    note = fields.TextField(null=True, description="备注")

    class Meta:
        table = "tbl_k_dict_var_domain"


class KDictVarFunc(Model):
    """
    Knowledge dict var func model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    code = fields.CharField(max_length=32, description="编码")
    value = fields.CharField(max_length=64, description="值")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.CharField(max_length=32, null=True, description="创建人")
    last_time = fields.DatetimeField(null=True, description="编辑时间")
    last_editor = fields.CharField(max_length=32, null=True, description="编辑人")
    note = fields.TextField(null=True, description="备注")

    class Meta:
        table = "tbl_k_dict_var_func"


class KDictVarSubgene(Model):
    """
    Knowledge dict var subgene model
    """
    sq_no = fields.IntField(pk=True, description="序号")
    code = fields.CharField(max_length=32, description="编码")
    value = fields.CharField(max_length=64, description="值")
    aa_position = fields.CharField(max_length=64, null=True, description="aa位置")
    gene_id = fields.IntField(description="基因标识")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.CharField(max_length=32, null=True, description="创建人")
    last_time = fields.DatetimeField(null=True, description="编辑时间")
    last_editor = fields.CharField(max_length=32, null=True, description="编辑人")
    note = fields.TextField(null=True, description="备注")

    class Meta:
        table = "tbl_k_dict_var_subgene"


class KDictVccname(Model):
    """
    Knowledge dict vcc name model
    """

    vc_class_id = fields.IntField(pk=True, description="变异种类类对象标识")
    vc_name = fields.CharField(max_length=64, description="变异种类名称")

    class Meta:
        table = "tbl_k_dict_vc_name"


class KDrug(Model):
    """
    Knowledge drug model
    """
    STATUS = (
        (0, "未启用"),
        (1, "正常"),
    )
    sq_no = fields.IntField(pk=True, description="序号")
    drug_id = fields.IntField(description="药物标识")
    status = fields.IntField(choices=STATUS, default=1, description="状态, 0-未启用，1-正常")
    general_name_en = fields.CharField(max_length=64, description="通用名-英文")
    general_name_cn = fields.CharField(max_length=32, description="通用名-中文")
    drug_type_code = fields.CharField(max_length=32, null=True, description="药物类型编码")
    drug_atc_id = fields.CharField(max_length=256, description="药物atc标识")
    drug_fda_id = fields.CharField(max_length=256, description="药物fda标识")
    nci_code = fields.CharField(max_length=256, description="nci编码")
    trade_name_en = fields.CharField(max_length=256, null=True, description="药品名-英文")
    trade_name_cn = fields.CharField(max_length=256, null=True, description="药品名-中文")
    research_code = fields.CharField(max_length=256, null=True, description="研究编码")
    drug_developers = fields.CharField(max_length=256, null=True, description="药物研发人")
    drug_alias = fields.TextField(description="药物昵称")
    drug_desc = fields.TextField(description="药物描述")
    drug_mechanism_en = fields.TextField(description="药物作用-英文")
    drug_mechanism_cn = fields.TextField(description="药物作用-中文")
    approval_fda = fields.CharField(max_length=256, null=True, description="美国卫生规格")
    approval_nmpa = fields.CharField(max_length=256, null=True, description="国药规格")
    approval_ema = fields.CharField(max_length=256, null=True, description="欧盟规格")
    approval_pmda = fields.CharField(max_length=256, null=True, description="日本规格")
    note = fields.TextField(null=True, description="备注")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.IntField(description="创建人")
    audit_time = fields.DatetimeField(null=True, description="审核时间")
    audit_user = fields.IntField(null=True, description="审核人")
    modify_time = fields.DatetimeField(null=True, description="更新时间")
    modify_user = fields.IntField(null=True, description="更新用户")

    class Meta:
        table = "tbl_k_drug"


class KDrugTarget(Model):
    """
    Knowledge drug target model
    """
    STATUS = (
        (0, "未启用"),
        (1, "正常"),
    )
    sq_no = fields.IntField(pk=True, description="序号")
    drug_id = fields.CharField(max_length=32, description="药物标识")
    status = fields.IntField(choices=STATUS, default=1, description="状态, 0-未启用，1-正常")
    target_id = fields.CharField(max_length=32, description="靶点标识")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.IntField(description="创建人")
    audit_time = fields.DatetimeField(null=True, description="审核时间")
    audit_user = fields.IntField(null=True, description="审核人")
    modify_time = fields.DatetimeField(null=True, description="更新时间")
    modify_user = fields.IntField(null=True, description="更新用户")

    class Meta:
        table = "tbl_k_drug_target"


class KEvi(Model):
    """
    Knowledge evi model
    """
    STATUS = (
        (0, "未启用"),
        (1, "正常"),
    )
    sq_no = fields.IntField(pk=True, description="编号")
    evi_id = fields.IntField(index=True, description="证据标识")
    status = fields.IntField(choices=STATUS, default=1, description="状态, 0-未启用，1-正常")
    mole_profile_id = fields.IntField(description="分子特征标识")
    tumor_id = fields.IntField(null=True, description="肿瘤标识")
    regimen_id = fields.IntField(index=True, description="方案标识")
    evi_direction = fields.CharField(max_length=128, null=True, description="证据指导")
    evi_result = fields.CharField(max_length=128, null=True, description="证据结果")
    evi_scale = fields.CharField(max_length=128, null=True, description="证据级别")
    trial_id = fields.IntField(null=True, description="试验标识")
    trial_alias = fields.CharField(max_length=64, null=True, description="试验昵称")
    result = fields.CharField(max_length=256, null=True, description="结果")
    result_cn = fields.TextField(description="结果-中文")
    result_en = fields.TextField(description="结果-英文")
    clinical_significance_id = fields.IntField(description="临床意义标识")
    pmid = fields.IntField(null=True, description="唯一标识码")
    refer_id = fields.IntField(null=True, description="参考标识")
    note = fields.TextField(null=True, description="备注")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.IntField(description="创建人")
    audit_time = fields.DatetimeField(null=True, description="审核时间")
    audit_user = fields.IntField(null=True, description="审核人")
    modify_time = fields.DatetimeField(null=True, description="更新时间")
    modify_user = fields.IntField(null=True, description="更新用户")
    regimen_indication_id = fields.IntField(null=True, description="适应症方案标识")
    approval_fda = fields.CharField(max_length=256, null=True, description="美国卫生规格")
    fda_appr = fields.CharField(max_length=256, null=True, description="美国卫生规格缩写")
    approval_nmpa = fields.CharField(max_length=256, null=True, description="国药规格")
    nmpa_appr = fields.CharField(max_length=256, null=True, description="国药规格缩写")
    approval_ema = fields.CharField(max_length=256, null=True, description="欧盟规格")
    ema_appr = fields.CharField(max_length=256, null=True, description="欧盟规格缩写")
    approval_pmda = fields.CharField(max_length=256, null=True, description="日本规格")
    pmda_appr = fields.CharField(max_length=256, null=True, description="日本规格缩写")
    expert_consensus = fields.CharField(max_length=256, null=True, description="专家共识")
    expert_csco = fields.CharField(max_length=256, null=True, description="中国临床肿瘤学会")
    expert_nccn = fields.CharField(max_length=256, null=True, description="亚洲共识声明")
    expert_detail = fields.TextField(null=True, description="细节")
    expert_type = fields.CharField(max_length=256, null=True, description="类型")
    clinical_source = fields.CharField(max_length=200, description="临床资源")
    interpretation = fields.TextField(null=True, description="说明")
    evi_category = fields.CharField(max_length=256, null=True, description="证据种类")
    evi_research_type_i = fields.CharField(max_length=256, null=True, description="证据研究类型i")
    evi_research_type_ii = fields.CharField(max_length=200, null=True, description="证据研究类型ii")
    preclinical_type = fields.CharField(max_length=200, null=True, description="潜伏期类型")
    tumor_group_id = fields.CharField(max_length=32, null=True, description="肿瘤组标识")
    var_func = fields.CharField(max_length=200, null=True, description="变异功能")
    var_oncogenicity = fields.CharField(max_length=1024, null=True, description="变异致瘤性")

    class Meta:
        table = "tbl_k_evi"


class KEviSum(Model):
    """
    Knowledge evi sum model
    """
    STATUS = (
        (0, "未启用"),
        (1, "正常"),
    )
    sq_no = fields.IntField(pk=True, description="序号")
    k_evi_sum_id = fields.IntField(null=True, description="标识")
    mole_profile_id = fields.IntField(null=True, description="分子特征标识")
    tumor_id = fields.IntField(index=True, description="肿瘤标识")
    evi_id = fields.IntField(null=True, description="证据标识")
    status = fields.IntField(choices=STATUS, default=1, description="状态, 0-未启用，1-正常")
    evi_archive = fields.TextField(description="证据档案")
    evi_sample_var = fields.CharField(max_length=32, description="变异样本")
    regimen_conclusion = fields.CharField(max_length=128, null=True, description="治疗方案结论")
    regimen_id = fields.IntField(null=True, description="治疗方案标识")
    version = fields.CharField(max_length=32, null=True, description="版本")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.IntField(description="创建人")
    audit_time = fields.DatetimeField(null=True, description="审核时间")
    audit_user = fields.IntField(null=True, description="审核人")
    modify_time = fields.DatetimeField(null=True, description="更新时间")
    modify_user = fields.IntField(null=True, description="更新用户")

    class Meta:
        table = "tbl_k_evi_sum"


class KGene(Model):
    """
    Knowledge gene model
    """
    STATUS = (
        (0, "未启用"),
        (1, "正常"),
    )
    sq_no = fields.IntField(pk=True, description="序号")
    gene_id = fields.IntField(description="基因标识")
    gene_symbol = fields.CharField(max_length=32, description="基因标志")
    gene_alias = fields.CharField(max_length=256, null=True, description="基因昵称")
    gene_name_en = fields.TextField(description="基因名-英文")
    gene_name_cn = fields.TextField(null=True, description="基因名-中文")
    chr = fields.CharField(max_length=32, description="染色体位置")
    cytoband = fields.CharField(max_length=255, description="染色体区段")
    orientation = fields.CharField(max_length=32, null=True, description="基因方向 + -")
    transcript_refseq = fields.CharField(max_length=255, null=True, description="参考文献序列转录本编号")
    transcript_ensembl = fields.CharField(max_length=255, null=True, description="基因组序列数据库转录本编号")
    hgnc_id = fields.IntField(description="hgnc标识")
    ensembl_id = fields.CharField(max_length=255, null=True, description="基因组序列数据库标识")
    omim_id = fields.CharField(max_length=255, null=True, description="人类遗传数据库标识")
    status = fields.IntField(choices=STATUS, default=1, description="状态, 0-未启用，1-正常")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.IntField(description="创建人")
    audit_time = fields.DatetimeField(null=True, description="审核时间")
    audit_user = fields.IntField(null=True, description="审核人")
    modify_time = fields.DatetimeField(null=True, description="更新时间")
    modify_user = fields.IntField(null=True, description="更新用户")

    class Meta:
        table = "tbl_k_gene"


class KGeneFunc(Model):
    """
    Knowledge gene func model
    """
    STATUS = (
        (0, "未启用"),
        (1, "正常"),
    )
    sq_no = fields.IntField(pk=True, description="序号")
    gene_id = fields.IntField(description="基因")
    gene_symbol = fields.CharField(max_length=32, description="基因标记")
    role_code = fields.CharField(max_length=32, null=True, description="角色编码")
    func_ncbi_en = fields.TextField(null=True, description="美国国家生物信息中心功能定义-英文")
    gene_type = fields.CharField(max_length=255, description="基因类型")
    feature_type = fields.CharField(max_length=128, null=True, description="功能类型")
    func_summary_en = fields.TextField(description="功能概要-英文")
    func_summary_cn = fields.TextField(description="功能概要-中文")
    status = fields.IntField(choices=STATUS, default=1, description="状态, 0-未启用，1-正常")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.IntField(description="创建人")
    audit_time = fields.DatetimeField(null=True, description="审核时间")
    audit_user = fields.IntField(null=True, description="审核人")
    modify_time = fields.DatetimeField(null=True, description="更新时间")
    modify_user = fields.IntField(null=True, description="更新用户")

    class Meta:
        table = "tbl_k_gene_func"


class KGermlineExplanation(Model):
    """
    Knowledge germline explanation model
    """
    DEL = (
        (0, "未废弃"),
        (1, "已废弃")
    )

    sq_no = fields.IntField(pk=True, description="序号")
    gene_id = fields.IntField(description="基因")
    gene_symbol = fields.CharField(max_length=32, description="基因标记")
    gene_desc = fields.TextField(description="基因描述-中文")
    gene_desc_en = fields.TextField(null=True, description="基因描述-英文")
    var_orgin = fields.CharField(max_length=200, null=True, description="变异源")
    drug_id = fields.CharField(max_length=200, description="药物标识-集合")
    drug_name = fields.CharField(max_length=200, description="药物名称-集合")
    genetic_risk = fields.TextField(description="遗传风险-中文")
    genetic_risk_en = fields.TextField(null=True, description="遗传风险-英文")
    clinical_decision = fields.TextField(description="临床决策-中文")
    clinical_decision_en = fields.TextField(null=True, description="临床决策-英文")
    is_delete = fields.IntField(choices=DEL, default=0, description="是否废弃，0-未废弃，1-废弃")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    creator = fields.CharField(max_length=32, description="创建人")
    last_editor = fields.CharField(max_length=32, null=True, description="编辑人")
    last_time = fields.DatetimeField(null=True, description="编辑时间")

    class Meta:
        table = "tbl_k_germline_explanation"


class KHgvsP(Model):
    """
    Knowledge hgvs p model
    """

    k_hgvs_p_id = fields.IntField(pk=True, description="标识")
    hgvs_p_id = fields.CharField(max_length=32, description="标识")
    var_name = fields.CharField(max_length=128, description="变异名")
    gene_symbol = fields.CharField(max_length=128, description="基因标志")
    hgvs_p = fields.CharField(max_length=128, description="人类基因组变异协会p命名")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.IntField(description="创建人")
    last_time = fields.DatetimeField(null=True, description="更新时间")
    last_editor = fields.IntField(null=True, description="编辑人")
    status = fields.IntField(default=1, description="状态")

    class Meta:
        table = "tbl_k_hgvs_p"


class KHgvsPCategory(Model):
    """
    Knowledge hgvs p category model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    hgvs_p_id = fields.CharField(max_length=32, description="")
    hgvs_p = fields.CharField(max_length=256, description="")
    var_id = fields.CharField(max_length=32, index=True)
    var_name = fields.CharField(max_length=200, description="")
    gene_symbol = fields.CharField(max_length=64, description="基因标志")
    gene_id = fields.IntField(max_length=256, description="")

    class Meta:
        table = "tbl_k_hgvs_p_category"


class KMoleProfile(Model):
    """
    Knowledge mole profile model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    status = fields.IntField(default=1, description="状态")
    mole_profile_id = fields.IntField(description="分子结构标识")
    mole_profile_name = fields.CharField(max_length=256, description="分子结构名称")
    gene_symbol = fields.CharField(max_length=64, description="基因标志")
    biomarker_name = fields.CharField(max_length=256, null=True, description="生物标志物名称")
    drug_name = fields.CharField(max_length=256, null=True, description="药物名称")
    evidence = fields.CharField(max_length=256, null=True, description="证据")
    introduction = fields.TextField(null=True, description="介绍说明")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.IntField(description="创建人")
    position = fields.CharField(max_length=256, null=True, description="位置")
    var_origin = fields.CharField(max_length=256, null=True, description="变异源")
    var_id = fields.CharField(max_length=256, description="变异标识")
    note = fields.CharField(max_length=256, null=True, description="备注")
    last_time = fields.DatetimeField(null=True, description="更新时间")
    last_editor = fields.IntField(null=True, description="编辑人")
    audit_time = fields.DatetimeField(null=True, description="审核时间")
    audit_user = fields.IntField(null=True, description="审核人")
    modify_time = fields.DatetimeField(null=True, description="更新时间")
    modify_user = fields.IntField(null=True, description="更新人")

    class Meta:
        table = "tbl_k_mole_profile"


class KMoleProfileComponent(Model):
    """
    Knowledge mole profile component model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    mole_profile_id = fields.IntField(index=True, description="分子结构标识")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    last_time = fields.DatetimeField(null=True, description="更新时间")
    mole_profile_component_id = fields.IntField(description="分子结构成分标识")
    var_name = fields.CharField(max_length=256, description="变异名称")
    table = fields.CharField(max_length=128, description="对应表")
    gene_symbol = fields.CharField(max_length=64, description="基因标志")
    component_id = fields.CharField(max_length=32, description="成分结构标识")
    var_id = fields.CharField(max_length=32, null=True, description="变异标识")
    var_origin = fields.CharField(max_length=256, null=True, description="变异源")
    var_type = fields.CharField(max_length=256, null=True, description="变异类型")
    position = fields.CharField(max_length=256, null=True, description="位置")

    class Meta:
        table = "tbl_k_mole_profile_component"


class KMsiClin(Model):
    """
    Knowledge msi clin model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    result_msi = fields.CharField(max_length=64, description="msi结果")
    drug_id_list = fields.CharField(max_length=200, null=True, description="药物标识集合")
    regimen_name_cn = fields.TextField(description="方案名称-中文")
    regimen_name_en = fields.CharField(max_length=256, null=True, description="方案名称-英文")
    result_cn = fields.TextField(description="结果-中文")
    result_en = fields.TextField(null=True, description="结果-英文")
    approval_fda = fields.CharField(max_length=200, description="fda标准")
    refer_id = fields.CharField(max_length=200, null=True, description="参考文献标识")
    last_time = fields.DatetimeField(null=True, description="更新时间")
    last_editor = fields.CharField(max_length=200, null=True, description="更新人")

    class Meta:
        table = "tbl_k_msi_clin"


class KPathway(Model):
    """
    Knowledge pathway model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    pathway_id = fields.IntField(description="途径标识")
    status = fields.IntField(default=1, description="状态")
    pathway_name = fields.CharField(max_length=256, description="途径名称")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.IntField(description="创建人")
    audit_time = fields.DatetimeField(null=True, description="审核时间")
    audit_user = fields.IntField(null=True, description="审核人")
    modify_time = fields.DatetimeField(null=True, description="更新时间")
    modify_user = fields.IntField(null=True, description="更新人")

    class Meta:
        table = "tbl_k_pathway"


class KPdl1Clin(Model):
    """
    Knowledge pdl1 clin model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    tumor_id = fields.IntField(description="肿瘤标识")
    tumor_name_cn = fields.CharField(max_length=200, description="肿瘤名称-中文")
    tumor_name_en = fields.CharField(max_length=200, description="肿瘤名称-英文")
    drug_id_list = fields.CharField(max_length=200, description="药物标识集合")
    regimen_name_cn = fields.TextField(description="方案名称-中文")
    drug_desc = fields.TextField(description="药物描述")
    update = fields.CharField(max_length=200, description="更新")
    note = fields.TextField(null=True, description="备注")
    note2 = fields.TextField(null=True, description="备注")

    class Meta:
        table = "tbl_k_pdl1_clin"


class KPharmClinAnn(Model):
    """
    Knowledge pharm clin ann model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    gene_symbol = fields.CharField(max_length=64, description="基因标志")
    location = fields.CharField(max_length=128, description="基因位置")
    related_diseases = fields.CharField(max_length=256, description="相关疾病")
    related_chemicals = fields.CharField(max_length=256, description="相关化学药品")
    evidence_level = fields.CharField(max_length=256, description="证据等级")
    clinical_ann_types = fields.CharField(max_length=256, description="临床神经网类型")
    geno_pheno_id = fields.IntField(description="基因组表型标识")
    genotype = fields.CharField(max_length=256, description="基因组类型")
    clinical_phenotype = fields.CharField(max_length=256, description="临床基因组类型")

    class Meta:
        table = "tbl_k_pharm_clin_ann"


class KRefer(Model):
    """
    Knowledge refer model
    """

    refer_id = fields.IntField(pk=True, description="标识")
    refer_type = fields.CharField(max_length=32, null=True, description="参考文献类型")
    pmid = fields.CharField(max_length=64, description="唯一标识码")
    confer_id = fields.IntField(null=True, description="授权标识")
    doi = fields.CharField(max_length=64, description="数字对象唯一标识符")
    url = fields.TextField(description="文献地址")
    authors = fields.TextField(description="作者")
    title = fields.TextField(description="标题")
    journal = fields.TextField(description="期刊")
    vol = fields.TextField(description="文献-卷")
    issue = fields.TextField(null=True, description="期号")
    date = fields.CharField(max_length=32, description="发布日期: 如 2011 Oct")
    abstract = fields.TextField(description="摘要")
    refer_attach_i = fields.TextField(null=True, description="参考附件i")
    refer_attach_ii = fields.TextField(null=True, description="参考附件ii")
    refer_attach_iii = fields.TextField(null=True, description="参考附件iii")
    comment = fields.TextField(null=True, description="支持图文混排")
    last_edited = fields.DatetimeField(null=True, description="编辑时间")
    last_editor = fields.CharField(max_length=32, null=True, description="编辑人")

    class Meta:
        table = "tbl_k_refer"


class KRegiman(Model):
    """
    Knowledge regimen model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    status = fields.IntField(default=1, description="状态")
    regimen_id = fields.CharField(max_length=32, description="方案标识")
    regimen_name_cn = fields.CharField(max_length=256, description="方案名称-中文")
    regimen_name_en = fields.CharField(max_length=256, description="方案名称-英文")
    regimen_name_abbr = fields.CharField(max_length=256, null=True, description="方案名称缩写")
    drug_count = fields.CharField(max_length=32, null=True, description="药物数量")
    drug_id = fields.CharField(max_length=32, null=True, description="药物标识")
    note = fields.TextField(null=True, description="备注")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.IntField(description="创建人")
    audit_time = fields.DatetimeField(null=True, description="审核时间")
    audit_user = fields.IntField(null=True, description="审核人")
    modify_time = fields.DatetimeField(null=True, description="更新时间")
    modify_user = fields.IntField(null=True, description="更新人")

    class Meta:
        table = "tbl_k_regimen"


class KRegimenAppr(Model):
    """
    Knowledge regimen abbr model
    """

    regimen_appr_id = fields.IntField(pk=True, description="方案缩写标识")
    dict_appr_organization_id = fields.IntField(description="组织机构缩写标识")
    status = fields.IntField(default=1, description="状态")
    regimen_id = fields.IntField(description="方案标识")
    comment = fields.TextField(description="说明-中文")
    comment_en = fields.TextField(description="说明-英文")
    organization = fields.CharField(max_length=256, description="组织机构")
    tumor_group_id = fields.CharField(max_length=32, description="肿瘤组标识")
    tumor_id = fields.CharField(max_length=32, description="肿瘤标识")
    appr_drug = fields.CharField(max_length=128, description="药物缩写")
    gene_id = fields.IntField(max_length=32, null=True, description="基因标识")
    gene_symbol = fields.CharField(max_length=64, null=True, description="基因标志")
    note = fields.TextField(null=True, description="备注")

    class Meta:
        table = "tbl_k_regimen_appr"


class KRegimenDrug(Model):
    """
    Knowledge regimen drug model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    regimen_id = fields.CharField(max_length=32, description="方案标识")
    drug_id = fields.CharField(max_length=32, description="药物标识")
    status = fields.IntField(default=1, description="状态")
    note = fields.TextField(null=True, description="备注")
    modify_user = fields.IntField(null=True, description="更新人")
    modify_time = fields.DatetimeField(null=True, description="更新时间")
    audit_user = fields.IntField(null=True, description="审核人")
    audit_time = fields.DatetimeField(null=True, description="审核时间")
    last_editor = fields.IntField(null=True, description="编辑人")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    last_time = fields.DatetimeField(null=True, description="更新时间")
    created_user = fields.IntField(description="创建人")

    class Meta:
        table = "tbl_k_regimen_drug"


class KRegimenIndication(Model):
    """
    Knowledge regimen indication model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.IntField(description="创建人")
    status = fields.IntField(default=1, description="状态")
    regimen_id = fields.IntField(description="方案标识")
    drug_id = fields.IntField(null=True, description="药物标识")
    tumor_id = fields.IntField(null=True, description="肿瘤标识")
    mole_cular_profile_id = fields.IntField(null=True, description="分子结构标识")
    indication_detail_cn = fields.CharField(max_length=256, description="指示详情-中文")
    indication_detail_en = fields.CharField(max_length=256, null=True, description="指示详情-英文")
    approval_fda = fields.CharField(max_length=256, null=True, description="美国卫生规格")
    approval_nmpa = fields.CharField(max_length=256, null=True, description="国药规格")
    approval_ema = fields.CharField(max_length=256, null=True, description="欧盟规格")
    approval_pmda = fields.CharField(max_length=256, null=True, description="日本规格")
    expert_consensus = fields.CharField(max_length=256, null=True, description="专家共识")
    expert_csco = fields.CharField(max_length=256, null=True, description="中国临床肿瘤学会")
    expert_nccn = fields.CharField(max_length=256, null=True, description="亚洲共识声明")
    expert_detail = fields.TextField(null=True, description="细节")
    expert_type = fields.CharField(max_length=256, null=True, description="类型")
    note = fields.TextField(null=True, description="备注")
    regimen_indication_id = fields.CharField(max_length=32, description="方案指示标识")
    tumor_code = fields.CharField(max_length=32, description="肿瘤编码")
    tumor_code_type = fields.CharField(max_length=32, null=True, description="肿瘤编码类型")
    tumor_group_id = fields.CharField(max_length=32, null=True, description="肿瘤组标识")
    audit_time = fields.DatetimeField(null=True, description="审核时间")
    audit_user = fields.IntField(null=True, description="审核人")
    modify_time = fields.DatetimeField(null=True, description="更新时间")
    modify_user = fields.IntField(null=True, description="更新人")

    class Meta:
        table = "tbl_k_regimen_indication"


class KSnvindel(Model):
    """
    Knowledge snvindel model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    var_id = fields.CharField(max_length=32, index=True, description="变异标识")
    var_id_previous = fields.CharField(max_length=32, null=True, description="之前的变异标识")
    gene_id = fields.IntField(max_length=256, description="基因标识")
    chr = fields.CharField(max_length=32, description="染色体")
    start = fields.CharField(max_length=32, description="开始位置")
    end = fields.CharField(max_length=32, description="结束位置")
    ref = fields.CharField(max_length=32, description="参考碱基")
    alt = fields.CharField(max_length=32, description="等位变异碱基")
    gene_symbol = fields.CharField(max_length=64, description="基因标志")
    primary_transcript = fields.CharField(max_length=256, description="原转录本")
    hgvs_c = fields.CharField(max_length=200, description="c位点")
    hgvs_p = fields.CharField(max_length=200, description="p位点")
    hgvs_p_abbr = fields.CharField(max_length=128, null=True, description="氨基酸三字母简写的HGVS变异命名")
    hgvs_g = fields.CharField(max_length=256, null=True, description="g位点")
    context = fields.TextField(null=True, description="上下文")
    type = fields.CharField(max_length=256, null=True, description="类型")
    var_ivs = fields.CharField(max_length=256, null=True, description="变异居间序列")
    var_alias = fields.CharField(max_length=256, null=True, description="变异昵称")
    gene_region = fields.CharField(max_length=256, description="基因区域")
    dbsnp = fields.CharField(max_length=256, null=True, description="dbsnp数据库")
    clivar_id = fields.CharField(max_length=256, null=True, description="临床变异标识")
    cosmic = fields.CharField(max_length=256, null=True, description="肿瘤中体细胞突变的目录")
    var_acmg_rule = fields.CharField(max_length=256, description="美国医学遗传学与基因组学学会规则")
    var_classification = fields.CharField(max_length=256, description="变异分类方法")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.IntField(description="创建人")
    audit_time = fields.DatetimeField(null=True, description="审核时间")
    audit_user = fields.IntField(null=True, description="审核人")
    modify_time = fields.DatetimeField(null=True, description="更新时间")
    modify_user = fields.IntField(null=True, description="更新人")
    status = fields.IntField(default=1, description="状态")
    var_name = fields.CharField(max_length=256, null=True, description="变异名称")
    refer_id = fields.CharField(max_length=32, null=True, description="参考文献标识")
    pmid = fields.CharField(max_length=64, null=True, description="唯一标识码")
    interpretation = fields.TextField(null=True, description="说明")
    var_category_ids = fields.CharField(max_length=200, null=True, description="变异种类标识集合")

    class Meta:
        table = "tbl_k_snvindel"
        unique_together = ("gene_symbol", "primary_transcript", "chr", "start", "end", "ref", "alt")
        indexes = ("gene_symbol", "primary_transcript", "hgvs_c", "hgvs_p")


class KSv(Model):
    """
    Knowledge sv model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.IntField(description="创建人")
    var_id = fields.CharField(max_length=32, description="变异标识")
    five_chr = fields.CharField(max_length=64, description="5基因染色体")
    five_gene_id = fields.IntField(description="5基因标识")
    five_region = fields.CharField(max_length=256, null=True, description="5基因区域")
    five_gene_transcript = fields.CharField(max_length=64, description="5基因转录本")
    five_chr_pos = fields.CharField(max_length=64, description="5基因染色体位置")
    five_gene_symbol = fields.CharField(max_length=64, description="5基因标志")
    five_cds = fields.CharField(max_length=64, description="5基因编码蛋白")
    five_flag = fields.CharField(max_length=10, description="5基因标识符")
    three_chr_pos = fields.CharField(max_length=64, description="3基因染色体位置")
    three_gene_symbol = fields.CharField(max_length=64, description="3基因标志")
    three_cds = fields.CharField(max_length=64, description="3基因编码蛋白")
    three_flag = fields.CharField(max_length=10, description="3基因标识符")
    three_region = fields.CharField(max_length=64, null=True, description="3基因区域")
    three_gene_transcript = fields.CharField(max_length=64, description="3基因转录本")
    three_chr = fields.CharField(max_length=64, description="3基因染色体")
    three_gene_id = fields.IntField(description="3基因标识")
    sv_sequence = fields.TextField(description="sv序列")
    inferred_breakpoint = fields.TextField(description="推断断点")
    status = fields.IntField(default=1, description="状态")
    last_time = fields.DatetimeField(null=True, description="更新时间")
    last_editor = fields.IntField(null=True, description="编辑人")
    audit_time = fields.DatetimeField(null=True, description="审核时间")
    audit_user = fields.IntField(null=True, description="审核人")
    modify_time = fields.DatetimeField(null=True, description="更新时间")
    modify_user = fields.IntField(null=True, description="更新人")
    var_name = fields.CharField(max_length=256, null=True, description="变异名称")
    refer_id = fields.CharField(max_length=32, null=True, description="参考文献标识")
    pmid = fields.CharField(max_length=64, null=True, description="唯一标识码")
    interpretation = fields.TextField(null=True, description="说明")
    var_category_ids = fields.CharField(max_length=200, null=True, description="变异种类标识集合")
    var_hgvs = fields.TextField(null=True, description="变异hgvs")

    class Meta:
        table = "tbl_k_sv"
        unique_together = ("five_chr_pos", "five_gene_symbol", "five_cds", "five_flag", "three_chr_pos",
                           "three_gene_symbol", "three_cds", "three_flag")


class KTarget(Model):
    """
    Knowledge target model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.IntField(description="创建人")
    target_id = fields.CharField(max_length=32, description="靶点标识")
    target_name_en = fields.CharField(max_length=256, description="靶点名-中文")
    target_name_cn = fields.CharField(max_length=256, description="靶点名-英文")
    target_alias = fields.CharField(max_length=256, null=True, description="靶点昵称")
    last_time = fields.DatetimeField(null=True, description="更新时间")
    last_editor = fields.IntField(null=True, description="编辑人")
    audit_time = fields.DatetimeField(null=True, description="审核时间")
    audit_user = fields.IntField(null=True, description="审核人")
    modify_time = fields.DatetimeField(null=True, description="更新时间")
    modify_user = fields.IntField(null=True, description="更新人")
    status = fields.IntField(default=1, description="状态")

    class Meta:
        table = "tbl_k_target"


class KTargetGene(Model):
    """
    Knowledge target gene model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.IntField(description="创建人")
    target_id = fields.CharField(max_length=32, description="靶点标识")
    gene_id = fields.IntField(description="基因标识")
    status = fields.IntField(default=1, description="状态")
    audit_time = fields.DatetimeField(null=True, description="审核时间")
    audit_user = fields.IntField(null=True, description="审核人")
    modify_time = fields.DatetimeField(null=True, description="更新时间")
    modify_user = fields.IntField(null=True, description="更新人")

    class Meta:
        table = "tbl_k_target_gene"


class KTargetPathway(Model):
    """
    Knowledge target pathway model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.IntField(description="创建人")
    target_id = fields.CharField(max_length=32, description="靶点标识")
    pathway_id = fields.CharField(max_length=32, description="途径标识")
    status = fields.IntField(default=1, description="状态")
    audit_time = fields.DatetimeField(null=True, description="审核时间")
    audit_user = fields.IntField(null=True, description="审核人")
    modify_time = fields.DatetimeField(null=True, description="更新时间")
    modify_user = fields.IntField(null=True, description="更新人")

    class Meta:
        table = "tbl_k_target_pathway"


class KTmbClin(Model):
    """
    Knowledge tmb clin model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    TMB_result = fields.CharField(max_length=200, description="tmb结果")
    drug_list = fields.CharField(max_length=200, description="药物标识集合")
    regimen_name_cn = fields.TextField(description="方案名-中文")
    regimen_name_en = fields.TextField(description="方案名-英文")
    result_cn = fields.TextField(description="结果-中文")
    result_en = fields.TextField(description="结果-英文")
    refer_id = fields.CharField(max_length=200, description="参考文献标识")
    last_time = fields.DatetimeField(null=True, description="更新时间")
    last_editor = fields.IntField(null=True, description="编辑人")

    class Meta:
        table = "tbl_k_tmb_clin"


class KTrialDetail(Model):
    """
    Knowledge trial detail model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    trial_nm = fields.CharField(max_length=256, description="试验名称编号")
    cohort_name = fields.CharField(max_length=256, null=True, description="队列名")
    tumor_name_cn = fields.CharField(max_length=256, description="肿瘤名称-中文")
    tumor_name_en = fields.CharField(max_length=256, description="肿瘤名称-英文")
    tumor_id = fields.IntField(description="肿瘤标识")
    tumor_group_id = fields.IntField(max_length=32, description="肿瘤组标识")
    regimen_name = fields.CharField(max_length=256, null=True, description="方案名称")
    regimen_id = fields.IntField(null=True, description="方案标识")
    criteria_type = fields.CharField(max_length=32, description="标准类型")
    biok_names = fields.CharField(max_length=256, description="突变名称")
    biok_ids = fields.CharField(max_length=256, null=True, description="突变标识集合")
    gene = fields.CharField(max_length=32, description="基因")
    status = fields.IntField(default=1, description="状态")
    validity = fields.CharField(max_length=256, null=True, description="合法性")
    edit_time = fields.DatetimeField(null=True, description="编辑时间")
    editor = fields.IntField(description="编辑人")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.IntField(description="创建人")
    note = fields.CharField(max_length=256, null=True, description="备注")
    update_note = fields.CharField(max_length=256, null=True, description="更新备注")

    class Meta:
        table = "tbl_k_trial_detail"


class KTumor(Model):
    """
    Knowledge tumor model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.IntField(description="创建人")
    tumor_id = fields.IntField(description="肿瘤标识")
    tumor_name_en = fields.CharField(max_length=256, description="肿瘤名称-英文")
    tumor_name_cn = fields.CharField(max_length=256, description="肿瘤名称-中文")
    tumor_name_abbr = fields.CharField(max_length=256, description="肿瘤名称-缩写")
    tumor_meta_nci_code = fields.CharField(max_length=256, null=True, description="肿瘤元nci编码")
    tumor_meta_umls_code = fields.CharField(max_length=256, null=True, description="肿瘤元umls编码")
    tumor_meta_maintype = fields.CharField(max_length=256, description="肿瘤元主类型")
    organ = fields.CharField(max_length=64, description="器官")
    organ_abbr = fields.CharField(max_length=32, description="器官缩写")
    organ_meta_nci_code = fields.CharField(max_length=256, description="器官元nci编码")
    organ_meta_umls_code = fields.CharField(max_length=256, description="器官元umls编码")
    organ_meta_maintype = fields.CharField(max_length=256, description="器官元主类型")
    tumor_type_i_code = fields.CharField(max_length=256, null=True, description="肿瘤类型i编码")
    tumor_type_i_name = fields.CharField(max_length=256, null=True, description="肿瘤类型i名称")
    tumor_group_id = fields.IntField(max_length=32, description="肿瘤组标识")
    disease_type = fields.CharField(max_length=256, description="疾病类型")
    medgen_code = fields.CharField(max_length=256, null=True, description="生物医药编码")
    moph_code_ii = fields.CharField(max_length=256, null=True, description="卫生部编码ii")
    top_part_code_ii = fields.CharField(max_length=256, null=True, description=" 顶部编码ii")
    status = fields.IntField(default=1, description="状态")
    last_time = fields.DatetimeField(null=True, description="更新时间")
    last_editor = fields.IntField(null=True, description="编辑人")
    audit_time = fields.DatetimeField(null=True, description="审核时间")
    audit_user = fields.IntField(null=True, description="审核人")
    note = fields.TextField(null=True, description="备注")

    class Meta:
        table = "tbl_k_tumor"


class KTumorClassification(Model):
    """
    Knowledge tumor classification model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.IntField(description="创建人")
    relationchain_id = fields.IntField(description="关系链标识")
    node1_tumor_id = fields.IntField(description="节点1肿瘤标识")
    node1_tumor_name = fields.CharField(max_length=256, description="节点1肿瘤名称")
    node2_tumor_id = fields.IntField(description="节点2肿瘤标识")
    node2_tumor_name = fields.CharField(max_length=256, description="节点2肿瘤名称")
    node3_tumor_id = fields.IntField(description="节点3肿瘤标识")
    node3_tumor_name = fields.CharField(max_length=256, description="节点3肿瘤名称")
    node4_tumor_id = fields.IntField(null=True, description="节点4肿瘤标识")
    node4_tumor_name = fields.CharField(max_length=256, null=True, description="节点4肿瘤名称")
    node5_tumor_id = fields.IntField(null=True, description="节点5肿瘤标识")
    node5_tumor_name = fields.CharField(max_length=256, null=True, description="节点5肿瘤名称")
    node6_tumor_id = fields.IntField(null=True, description="节点6肿瘤标识")
    node6_tumor_name = fields.CharField(max_length=256, null=True, description="节点6肿瘤名称")
    expert_consensus = fields.CharField(max_length=1024, null=True, description="专家共识")
    nccn = fields.CharField(max_length=256, null=True, description="综合癌症网络")
    oncotree = fields.CharField(max_length=10, default="Y", description="肿瘤树")
    who = fields.CharField(max_length=256, null=True, description="具体人")
    status = fields.IntField(default=1, description="状态")
    modify_user = fields.IntField(null=True, description="更新人")
    modify_time = fields.DatetimeField(null=True, description="更新时间")
    audit_user = fields.IntField(null=True, description="审核人")
    audit_time = fields.DatetimeField(null=True, description="审核时间")
    chain_status = fields.IntField(default=1, description="状态")

    class Meta:
        table = "tbl_k_tumor_classification"


class KTumorGroup(Model):
    """
    Knowledge tumor group model
    """

    k_tumor_group_id = fields.IntField(pk=True, description="知识库肿瘤组标识")
    k_tumor_group_name = fields.CharField(max_length=256, description="知识库肿瘤组名称")

    class Meta:
        table = "tbl_k_tumor_group"


class KVarCategory(Model):
    """
    Knowledge var category model
    """

    sq_no = fields.IntField(pk=True, description="序号")
    var_id = fields.CharField(max_length=200, index=True, description="变异标识")
    var_category_id = fields.CharField(max_length=200, index=True, description="变异种类标识")
    status = fields.IntField(default=1, description="状态")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.IntField(description="创建人")
    last_editor = fields.IntField(null=True, description="编辑人")
    last_time = fields.DatetimeField(null=True, description="更新时间")

    class Meta:
        table = "tbl_k_var_category"


class KVarGInterpretation(Model):
    """
    Knowledge var g interpretation model
    """

    k_var_g_interpretation_id = fields.IntField(pk=True, description="")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.IntField(description="创建人")
    var_id = fields.CharField(max_length=32, description="变异标识")
    ba1_reason = fields.IntField(default=0, description="ba1原因")
    ba1_result = fields.TextField(null=True, description="ba1结果")
    bs1_reason = fields.IntField(default=0, description="bs1原因")
    bs1_result = fields.TextField(null=True, description="bs1结果")
    bs2_reason = fields.IntField(default=0, description="bs2原因")
    bs2_result = fields.TextField(null=True, description="bs2结果")
    bs3_reason = fields.IntField(default=0, description="bs3原因")
    bs3_result = fields.TextField(null=True, description="bs3结果")
    bs4_reason = fields.IntField(default=0, description="bs4原因")
    bs4_result = fields.TextField(null=True, description="bs4结果")
    bp1_reason = fields.IntField(default=0, description="bp1原因")
    bp1_result = fields.TextField(null=True, description="bp1结果")
    bp2_reason = fields.IntField(default=0, description="bp2原因")
    bp2_result = fields.TextField(null=True, description="bp2结果")
    bp3_reason = fields.IntField(default=0, description="bp3原因")
    bp3_result = fields.TextField(null=True, description="bp3结果")
    bp4_reason = fields.IntField(default=0, description="bp4原因")
    bp4_result = fields.TextField(null=True, description="bp4结果")
    bp5_reason = fields.IntField(default=0, description="bp5原因")
    bp5_result = fields.TextField(null=True, description="bp5结果")
    bp6_reason = fields.IntField(default=0, description="bp6原因")
    bp6_result = fields.TextField(null=True, description="bp6结果")
    bp7_reason = fields.IntField(default=0, description="bp7原因")
    bp7_result = fields.TextField(null=True, description="bp7结果")
    pp1_reason = fields.IntField(default=0, description="pp1原因")
    pp1_result = fields.TextField(null=True, description="pp1结果")
    pp2_reason = fields.IntField(default=0, description="pp2原因")
    pp2_result = fields.TextField(null=True, description="pp2结果")
    pp3_reason = fields.IntField(default=0, description="pp3原因")
    pp3_result = fields.TextField(null=True, description="pp3结果")
    pp4_reason = fields.IntField(default=0, description="pp4原因")
    pp4_result = fields.TextField(null=True, description="pp4结果")
    pp5_reason = fields.IntField(default=0, description="pp5原因")
    pp5_result = fields.TextField(null=True, description="pp5结果")
    pm1_reason = fields.IntField(default=0, description="pm1原因")
    pm1_result = fields.TextField(null=True, description="pm1结果")
    pm2_reason = fields.IntField(default=0, description="pm2原因")
    pm2_result = fields.TextField(null=True, description="pm2结果")
    pm3_reason = fields.IntField(default=0, description="pm3原因")
    pm3_result = fields.TextField(null=True, description="pm3结果")
    pm4_reason = fields.IntField(default=0, description="pm4原因")
    pm4_result = fields.TextField(null=True, description="pm4结果")
    pm5_reason = fields.IntField(default=0, description="pm5原因")
    pm5_result = fields.TextField(null=True, description="pm5结果")
    pm6_reason = fields.IntField(default=0, description="pm6原因")
    pm6_result = fields.TextField(null=True, description="pm6结果")
    ps1_reason = fields.IntField(default=0, description="ps1原因")
    ps1_result = fields.TextField(null=True, description="ps1结果")
    ps2_reason = fields.IntField(default=0, description="ps2原因")
    ps2_result = fields.TextField(null=True, description="ps2结果")
    ps3_reason = fields.IntField(default=0, description="ps3原因")
    ps3_result = fields.TextField(null=True, description="ps3结果")
    ps4_reason = fields.IntField(default=0, description="ps4原因")
    ps4_result = fields.TextField(null=True, description="ps4结果")
    pvs1_reason = fields.IntField(default=0, description="pvs1原因")
    pvs1_result = fields.TextField(null=True, description="pvs1结果")
    var_acmg_classification = fields.IntField(description="acmg变异分类方法")
    var_interpretation = fields.TextField(null=True, description="变异解释说明-中文")
    var_interpretation_en = fields.TextField(null=True, description="变异解释说明-英文")
    acmg_evidence = fields.CharField(max_length=128, null=True, description="acmg证据")
    var_id_history = fields.CharField(max_length=32, null=True, description="变异标识历史")
    status = fields.IntField(default=1, description="状态")
    last_time = fields.DatetimeField(null=True, description="更新时间")
    last_editor = fields.IntField(null=True, description="编辑人")
    update_note = fields.TextField(null=True, description="备注")

    class Meta:
        table = "tbl_k_var_g_interpretation"


class KVarSInterpretation(Model):
    table = "tbl_k_var_s_interpretation"

    sq_no = fields.IntField(pk=True, description="序号")
    created_time = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    created_user = fields.CharField(max_length=32, description="")
    var_id = fields.CharField(max_length=200, description="")
    tumor_id = fields.CharField(max_length=64, description="")
    var_interpretation = fields.TextField(null=True, description="")
    update_record = fields.TextField(null=True, description="")
    note = fields.TextField(null=True, description="备注")
    last_editor = fields.CharField(max_length=32, null=True, description="编辑人")
    last_time = fields.DatetimeField(null=True, description="更新时间")
    var_func = fields.TextField(null=True, description="")
    var_oncogenicity = fields.CharField(max_length=32, description="")
    current_user = fields.CharField(max_length=32, description="")
    status = fields.CharField(max_length=64, description="")
    var_interpretation_en = fields.TextField(null=True, description="")


class KnowlegeMatch(Model):
    """
    Knowledge match model
    """

    id = fields.IntField(pk=True, description="")
    create_date = fields.DatetimeField(auto_now=True, default=time_now(), description="创建时间")
    write_date = fields.DatetimeField(null=True, description="更新时间")
    match_id = fields.IntField(index=True, description="匹配的id")
    match_tablename = fields.CharField(max_length=200, description="匹配的表")
    matched_tablename = fields.CharField(max_length=200, description="被匹配的表")
    matched_id = fields.IntField(index=True, description="被匹配的id")

    class Meta:
        table = "tbl_knowledge_match"
